﻿using System.Linq;
using RuTracker.Interface.Editors;

namespace RuTrackerLib.Editors
{
    public class HtmlEditor : IHtmlEditor
    {
        private readonly IHtmlEditor[] _childEditors;
        public HtmlEditor(IHtmlEditor[] childEditors)
        {
            _childEditors = childEditors;
        }

        public string Edit(string html)
        {
            return _childEditors.Aggregate(html, (current, editor) => editor.Edit(current));
        }
    }
}
